<?php 
//1.验证用户提交过来的邮箱与网址是否正确
$email = '410004417@qq.com';
$email = '410004417@houdunwang.com';
$email = '410004417@163.com';
$email = 'houdunwangmzy@163.com';
$email = 'houdunwang-mzy@126.cn';
$email = 'houdunwang_mzy@sina.com.cn';

$preg = "/^([\w,-]*)@(qq|houdunwang|163|126|sina)\.(com|cn|com\.cn)$/i";
preg_match($preg, $email, $arr);
echo '<pre>';
print_r($arr);
echo '</pre>';

$url = 'www.baidu.com';
$url = 'http://www.baidu.com';
$url = 'https://git.oschina.net';
$url = 'bbs.houdunwang.com';
$url = 'houdunwang.com';
$url = 'www.12306.com';
$url = 'www.baidu-wang.com';

$preg = "/^(http:\/\/|https:\/\/)?(www\.|git\.|bbs\.)?(baidu|oschina|houdunwang|12306|baidu-wang)\.(com|net)$/i";
preg_match_all($preg, $url, $arr);
echo '<pre>';
print_r($arr);
echo '</pre>';












 ?>